home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / msoftapp.zip / DIBAPI.H < prev    next >
C/C++ Source or Header  |  1993-06-01  |  2KB  |  50 lines

  1. // dibapi.h
  2.  
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and Microsoft
  9. // QuickHelp and/or WinHelp documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13.  
  14. #ifndef _INC_DIBAPI
  15. #define _INC_DIBAPI
  16.  
  17. /* Handle to a DIB */
  18. DECLARE_HANDLE(HDIB);
  19.  
  20. /* DIB constants */
  21. #define PALVERSION   0x300
  22.  
  23. /* DIB Macros*/
  24.  
  25. #define IS_WIN30_DIB(lpbi)  ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER))
  26. #define RECTWIDTH(lpRect)     ((lpRect)->right - (lpRect)->left)
  27. #define RECTHEIGHT(lpRect)    ((lpRect)->bottom - (lpRect)->top)
  28.  
  29. // WIDTHBYTES performs DWORD-aligning of DIB scanlines.  The "bits"
  30. // parameter is the bit count for the scanline (biWidth * biBitCount),
  31. // and this macro returns the number of DWORD-aligned bytes needed
  32. // to hold those bits.
  33.  
  34. #define WIDTHBYTES(bits)    (((bits) + 31) / 32 * 4)
  35.  
  36. /* Function prototypes */
  37. BOOL      WINAPI  PaintDIB (HDC, LPRECT, HDIB, LPRECT, CPalette* pPal);
  38. BOOL      WINAPI  CreateDIBPalette(HDIB hDIB, CPalette* cPal);
  39. LPSTR     WINAPI  FindDIBBits (LPSTR lpbi);
  40. DWORD     WINAPI  DIBWidth (LPSTR lpDIB);
  41. DWORD     WINAPI  DIBHeight (LPSTR lpDIB);
  42. WORD      WINAPI  PaletteSize (LPSTR lpbi);
  43. WORD      WINAPI  DIBNumColors (LPSTR lpbi);
  44. HANDLE    WINAPI  CopyHandle (HANDLE h);
  45.  
  46. BOOL      WINAPI  SaveDIB (HDIB hDib, CFile& file);
  47. HDIB      WINAPI  ReadDIBFile(CFile& file);
  48.  
  49. #endif //!_INC_DIBAPI
  50.